﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;
using ModelClassesLinqToSql.Domain.Models;
using ModelClassesLinqToSql.Domain.Repositories;

namespace ModelClassesLinqToSql.Controllers
{
    public class HomeController : Controller
    {
        private IEmployeeRepository repository;

        public HomeController() : this(new EmployeeRepository()) 
        {
            
        }

        public HomeController(IEmployeeRepository repository)
        {
            this.repository = repository;
        }

        //
        // GET: /Home/
        public ActionResult Index()
        {
            return View(this.repository.GetAll());
        }
    }
}
